package com.lkx.web;

import com.lkx.dao.OrderMapper;
import com.lkx.domain.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: OrderController
 * Function:  TODO
 * Date:      2020/3/2 10:01
 * author     Kaixuan.Li01
 * version    V1.0
 * CopyRight: 吉利汽车电商
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderMapper orderMapper;

    @RequestMapping("/add")
    public String add(){
        Order order = new Order();
        order.setOrderId("789");
        order.setCreateTime(123);
        order.setSaleName("lkx");
        orderMapper.insert(order);
        return order.getOrderId();
    }
    @RequestMapping("/select")
    public String select(){
        return orderMapper.selectByPrimaryKey(new Long(1)).getOrderId();
    }
}
